/* ============ 时间轴容器 ============ */

.timeline-wrapper {
    display: flex;
    flex-direction: column;
}

.timeline-wrapper.timeline-horizontal {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 16px;
}

.timeline-wrapper.timeline-reverse {
    flex-direction: column-reverse;
}

/* ============ 时间轴项 ============ */

.timeline-item {
    display: flex;
    position: relative;
    margin-bottom: 24px;
}

.timeline-horizontal .timeline-item {
    flex-direction: column;
    margin-bottom: 0;
    margin-right: 24px;
    min-width: 200px;
}

.timeline-left .timeline-item {
    flex-direction: row;
}

.timeline-right .timeline-item {
    flex-direction: row-reverse;
}

.timeline-alternate .timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-alternate .timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

/* ============ 时间轴点 ============ */

.timeline-dot {
    position: relative;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-dot.default {
    background: var(--primary-color);
}

.timeline-dot.success {
    background: #52c41a;
    box-shadow: 0 0 0 2px #52c41a;
}

.timeline-dot.error {
    background: #ff4d4f;
    box-shadow: 0 0 0 2px #ff4d4f;
}

.timeline-dot.warning {
    background: #faad14;
    box-shadow: 0 0 0 2px #faad14;
}

.timeline-dot.info {
    background: #1890ff;
    box-shadow: 0 0 0 2px #1890ff;
}

.timeline-pending-dot {
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-spinner {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: timeline-spin 1s linear infinite;
}

@keyframes timeline-spin {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============ 时间轴线 ============ */

.timeline-item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 24px;
    width: 2px;
    height: calc(100% + 24px);
    background: #f0f0f0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-right .timeline-item::before {
    left: auto;
    right: 7px;
}

.timeline-horizontal .timeline-item::before {
    display: none;
}

.timeline-horizontal .timeline-item::after {
    content: '';
    position: absolute;
    top: 24px;
    left: 24px;
    width: calc(100% + 24px);
    height: 2px;
    background: #f0f0f0;
}

.timeline-horizontal .timeline-item:last-child::after {
    display: none;
}

/* ============ 时间轴内容 ============ */

.timeline-content {
    flex: 1;
    padding-left: 16px;
}

.timeline-right .timeline-content {
    padding-left: 0;
    padding-right: 16px;
}

.timeline-horizontal .timeline-content {
    padding-left: 0;
    padding-top: 16px;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============ 进行中状态 ============ */

.timeline-pending {
    opacity: 0.6;
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
    .timeline-item {
        margin-bottom: 20px;
    }

    .timeline-horizontal .timeline-item {
        min-width: 150px;
        margin-right: 16px;
    }

    .timeline-dot {
        width: 14px;
        height: 14px;
        margin-top: 3px;
    }

    .timeline-content {
        padding-left: 12px;
    }

    .timeline-right .timeline-content {
        padding-right: 12px;
    }

    .timeline-title {
        font-size: 13px;
    }

    .timeline-time {
        font-size: 11px;
    }

    .timeline-description {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .timeline-alternate .timeline-item:nth-child(even) {
        flex-direction: row;
    }

    .timeline-alternate .timeline-item:nth-child(even) .timeline-content {
        padding-left: 12px;
        padding-right: 0;
    }

    .timeline-item {
        margin-bottom: 16px;
    }

    .timeline-dot {
        width: 12px;
        height: 12px;
        margin-top: 2px;
    }

    .timeline-content {
        padding-left: 10px;
    }

    .timeline-title {
        font-size: 12px;
    }

    .timeline-time {
        font-size: 10px;
    }

    .timeline-description {
        font-size: 11px;
    }
}
